<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>单表管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
			$('#basicInfor').collapse({toggle: false});
			$('#patientDetails').collapse('show');
			$('#regisInfor').collapse('toggle');
			$('#basicInfor').collapse('hide');
			

		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/clinic/ptPatient/">患者列表</a></li>
		<li class="active">
			<a href="${ctx}/clinic/ptPatient/form?id=${ptPatient.id}">患者<shiro:hasPermission name="clinic:ptPatient:edit">${not empty ptPatient.id?'编辑':'录入'}</shiro:hasPermission><shiro:lacksPermission name="clinic:ptPatient:edit">查看</shiro:lacksPermission></a>
		</li>
	</ul><br/>
	
	<form:form id="inputForm" modelAttribute="ptPatient" action="${ctx}/clinic/ptPatient/save" method="post" class="form-horizontal" >
		<form:hidden path="id" />
		<sys:message content="${message}" />
		<div class="panel-group" id="accordion">
			<div class="panel panel-default">
				<div class="panel-heading">
					<h4 class="panel-title">
						<a data-toggle="collapse" data-parent="#accordion" href="#basicInfor">患者基本信息</a>
					</h4>
				</div>
				<div id="basicInfor" class="panel-collapse collapse in">
					<div class="panel-body">
						<div class="row">
							<div class="col-md-12">
								<div class="form-body">
									<div class="form-group">
										<table class="table table-striped table-bordered table-hover"
											data-width="890" data-height="680">
											<tr role="row" class="heading">
												<td align="right" width="15%">
													<label class="control-label col-md-13">病人姓名：</label>
												</td>
												<td width="35%">
													<div class="col-md-20">
														<div class="input-icon right">
															<form:input path="patientName" htmlEscape="false" 
																maxlength="50" class="input-xlarge " />
														</div>
													</div>
												</td>
												<td width="15%" align="right">
													<label class="control-label col-md-13">病人性别：</label>
												</td>
												<td width="35%">
													<div class="col-md-20">
														<div class="input-icon right">
															<form:radiobuttons path="patientSex"
																items="${fns:getDictList('sex')}" itemLabel="label"
																itemValue="value" htmlEscape="false" class="" />
														</div>
													</div>
												</td>
											</tr>
											<tr role="row" class="heading">
												<td align="right" width="15%">
													<label class="control-label col-md-13">病人年龄：</label>
												</td>
												<td width="35%">
													<div class="col-md-20">
														<div class="input-icon right">
															<form:input path="patientAge" htmlEscape="false"
																class="input-xlarge " cssStyle="width:45px;" />
															<form:input path="ageNuit" htmlEscape="false"
																class="input-xlarge " cssStyle="width:45px;" />
														</div>
													</div>
												</td>
												<td width="15%" align="right">
													<label class="control-label col-md-13">病人出生日期：</label>
												</td>
												<td width="35%">
													<div class="col-md-20">
														<div class="input-icon right">
															<input name="patientBarth" type="text"
																readonly="readonly" maxlength="20" class="input-medium Wdate "
																value="<fmt:formatDate value="${ptPatient.patientBarth}" pattern="yyyy-MM-dd"/>"
																onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});" />
														</div>
													</div>
												</td>
											</tr>
										</table>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="panel panel-success">
				<div class="panel-heading">
					<h4 class="panel-title">
						<a data-toggle="collapse" data-parent="#accordion" href="#patientDetails">患者详细信息</a>
					</h4>
				</div>
				<div id="patientDetails" class="panel-collapse collapse">
					<div class="panel-body">
						<div class="row">
							<div class="col-md-12">
								<div class="form-body">
									<div class="form-group">
										<table class="table table-striped table-bordered table-hover"
											data-width="890" data-height="680">
											<tr role="row" class="heading">
												<td align="right" width="15%">
													<label class="control-label col-md-13">婚姻状况：</label>
												</td>
												<td width="35%">
													<div class="col-md-20">
														<div class="input-icon right">
															<form:radiobuttons path="patientMarrge"
																items="${fns:getDictList('marstate')}" itemLabel="label"
																itemValue="value" htmlEscape="false" />
														</div>
													</div>
												</td>
												<td width="15%" align="right">
													<label class="control-label col-md-13">民族：</label>
												</td>
												<td width="35%">
													<div class="col-md-20">
														<div class="input-icon right">
															<form:input path="patientNation" htmlEscape="false"
																maxlength="10" class="input-xlarge " />
														</div>
													</div>
												</td>
											</tr>
											<tr role="row" class="heading">
												<td width="15%" align="right">
													<label class="control-label col-md-13">身份证：</label>
												</td>
												<td width="35%" colspan="3">
													<div class="col-md-20">
														<div class="input-icon right">
															<form:input path="patientIdcard" htmlEscape="false"
																maxlength="20" class="input-xlarge " />
														</div>
													</div>
												</td>
											</tr>
											<tr role="row" class="heading">
												<td width="15%" align="right">
													<label class="control-label col-md-13">职业：</label>
												</td>
												<td width="35%">
													<div class="col-md-20">
														<div class="input-icon right">
															<form:input path="patientOcc" htmlEscape="false"
																maxlength="10" class="input-xlarge " />
														</div>
													</div>
												</td>
												<td width="15%" align="right">
													<label class="control-label col-md-13">血型：</label>
												</td>
												<td width="35%">
													<div class="col-md-20">
														<div class="input-icon right">
															<form:input path="patientBlood" htmlEscape="false"
																maxlength="10" class="input-xlarge " />
														</div>
													</div>
												</td>
											</tr>
											
											<tr role="row" class="heading">
												<td width="15%" align="right">
													<label class="control-label col-md-13">联系地址：</label>
												</td>
												<td width="35%">
													<div class="col-md-20">
														<div class="input-icon right">
															<form:input path="patientAddress" htmlEscape="false"
																maxlength="255" class="input-xlarge " />

														</div>
													</div>
												</td>
												<td width="15%" align="right">
													<label class="control-label col-md-13">联系电话：</label>
												</td>
												<td width="35%">
													<form:input path="patientTel"
														htmlEscape="false" maxlength="20" class="input-xlarge " />
												</td>
											</tr>
											<tr role="row" class="heading">
												<td width="15%" align="right">
													<label class="control-label col-md-13">单位地址：</label>
												</td>
												<td width="35%">
													<form:input path="patientDwadd"
														htmlEscape="false" maxlength="255" class="input-xlarge " />
												</td>
												<td width="15%" align="right">
													<label class="control-label col-md-13">单位电话：</label>
												</td>
												<td width="35%" >
													<div class="col-md-20">
														<div class="input-icon right">
															<form:input path="patientDwtel" htmlEscape="false"
																maxlength="20" class="input-xlarge " />
														</div>
													</div>
												</td>
											</tr>
										</table>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="panel panel-info">
				<div class="panel-heading">
					<h4 class="panel-title">
						<a data-toggle="collapse" data-parent="#accordion" href="#regisInfor">患者挂号信息</a>
					</h4>
				</div>
				<div id="regisInfor" class="panel-collapse collapse">
					<div class="panel-body">
						<div class="row">
							<div class="col-md-12">
								<div class="form-body">
									<div class="form-group">
										<table class="table table-striped table-bordered table-hover"
											data-width="890" data-height="680">
											<tr role="row" class="heading">
												<td width="15%" align="right">
													<label class="control-label col-md-13">病人类型：</label>
												</td>
												<td width="35%">
													<div class="col-md-20">
														<div class="input-icon right">
															<form:input path="patientType" htmlEscape="false"
																maxlength="10" class="input-xlarge " />
														</div>
													</div>
												</td>
												<td width="15%" align="right">
													<label class="control-label col-md-13">挂号类型：</label>
												</td>
												<td width="35%">
													<div class="col-md-20">
														<div class="input-icon right">
															<form:input path="regType" htmlEscape="false"
																maxlength="10" class="input-xlarge " />
														</div>
													</div>
												</td>
											</tr>
											<tr role="row" class="heading">
												<td align="right">
													<label class="control-label">就诊科室：</label>
												</td>
												<td>
													<div class="col-md-20">
														<div class="input-icon right">
															<form:input path="regDept" htmlEscape="false"
																maxlength="50" class="input-xlarge " />
														</div>
													</div>
												</td>
												<td align="right">
													<label class="control-label">就诊医生：</label>
												</td>
												<td>
													<div class="col-md-20">
														<div class="input-icon right">
															<form:input path="regDoctor" htmlEscape="false"
																maxlength="50" class="input-xlarge " />
														</div>
													</div>
												</td>
											</tr>
											<tr>
												<td width="15%" align="right">
													<label class="control-label col-md-13">登记人：</label>
												</td>
												<td width="35%">
													<div class="col-md-20">
														<div class="input-icon right">
															<form:input path="opMark" htmlEscape="false"
																maxlength="50" class="input-xlarge " />
														</div>
													</div>
												</td>
												<td width="15%" align="right">
													<label class="control-label col-md-13">登记时间：</label>
												</td>
												<td width="35%">
													<div class="col-md-20">
														<div class="input-icon right">
															<input name="opDate" type="text" readonly="readonly"
																maxlength="20" class="input-medium Wdate "
																value="<fmt:formatDate value="${ptPatient.opDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
																onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});" />
														</div>
													</div>
												</td>
											</tr>
										</table>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="modal-footer">
			<shiro:hasPermission name="clinic:ptPatient:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>